package com.zhanghu.backendZray.exception;


import com.zhanghu.backendZray.pojo.dto.ApiResponse;

public class ApiException extends RuntimeException {
    private final Integer status;

    private final String code;

    public ApiException(String message) {
        this(ApiResponse.Status.SERVICE_FAILED, message, null);
    }

    public ApiException(Integer status, String message) {
        this(status, message, null);
    }

    public ApiException(Integer status, String message, String code) {
        super(message);
        this.status = status;
        this.code = code;
    }

    public Integer getStatus() {
        return status;
    }

    public String getCode() {
        return code;
    }

}
